 <{extends file="<{$tempdir}>/public/admin.html"}>
  <{block name=extendjs}>
   <script src="<{$siteurl}>/js/kindeditor/kindeditor.js" type="text/javascript" language="javascript"></script>
 <script src="<{$siteurl}>/templates/<{$tempdir}>/public/js/datepicker/WdatePicker.js" type="text/javascript" language="javascript"></script>
   <script type="text/javascript" language="javascript" src="<{$siteurl}>/templates/<{$tempdir}>/public/js/ajaxfileupload.js"> </script>

  <{/block}>
 <{block name=controlname}>编辑/添加店铺分类广告<{/block}>
 <{block name=bodylist}>


       <div style="width:98%;overflow-y:auto;white-space:nowrap;height:760px;">

          <div class="tags">

          <div id="tagscontent">
            <form method="post" name="form1" action="<{ofunc type=url link="/adminpage/shop/module/saveshopcateadv"}>"  >
              <div>
                <table border="0" cellspacing="2" cellpadding="4" class="list" name="table" id="table" width="100%">
                  <tbody>

                   <tr onmouseover="this.bgColor='#F5F5F5';" onmouseout="this.bgColor='ffffff';" bgcolor="ffffff" id="selecttrstart">
                      <td class="left">分类</td>
                      <td>
					  <{if !empty($moretypelist)}>
						<select name="cateid">
							<option value="0"   >请选择分类</option>
							 <{foreach from=$moretypelist item=itv}>
								
								 <option value="<{$itv['param']}>" <{if $info['cateid'] == $itv['param']}> selected <{/if}> ><{$catarr[$itv['activity']]}>-<{$itv['name']}></option>
							 <{/foreach}>  
					  <{else}>
							请先填写分类后在设置
					  <{/if}>
					  
                     </tr>
				  
				   <tr>
					 <td class="left">图片</td>
 					<td>
					<img src="<{$info['img']}>" width="136" height="130"  id="imgshow" <{if  empty($info['img'])}> style="display:none;"<{/if}> /> 
					<input type="hidden" name="img" id="img" value="<{$info['img']}>" class="skey" style="width:150px;" >  
					   <div id="div-headpicUpload" style="display:block;"> 
		                  <form id="form1" name="form1" method="post"  enctype="multipart/form-data" target="ifr-headpic-upload" onsubmit="return checkImagetype('1');">    
		                  	<div class=""> 
		               		<input name="head" type="file" id="imgFile" style="width:70px;float:left;margin-top:5px;" name="imgFile" onchange="$('#input1').val($(this).val())"  class="curbtn">
		               		<input id="submitImg" type="button" value="上传" class="ss_sc curbtn" style="width:40px;float:left; border:1px solid #ccc;background-color:white;height:22px;line-height:12px;margin-top:5px;margin-left:20px;" >   
		               	</div>  
		               </form> 
		             </div>
					  </td>
		  
				   </tr>
				   
				       <tr onmouseover="this.bgColor='#F5F5F5';" onmouseout="this.bgColor='ffffff';" bgcolor="ffffff" id="selecttrstart">
                      <td class="left">跳转链接</td>
                      <td><input type="text" name="link" id="link" value="<{$info['link']}>" class="skey" style="width:200px;" >（如果填写请填写完成链接，比如：<{$siteurl}>）</td>
                    </tr>
 
				   
				   
				   <tr onmouseover="this.bgColor='#F5F5F5';" onmouseout="this.bgColor='ffffff';" bgcolor="ffffff" id="selecttrstart">
                      <td class="left">标题</td>
                      <td><input type="text" name="title" id="title" value="<{$info['title']}>" class="skey" style="width:350px;" >（选填）</td>
                    </tr>
				 <tr onmouseover="this.bgColor='#F5F5F5';" onmouseout="this.bgColor='ffffff';" bgcolor="ffffff" id="selecttrstart">
                      <td class="left">描述</td>
                      <td><input type="text" name="desc" id="desc" value="<{$info['desc']}>" class="skey" style="width:350px;" >（选填）</td>
                    </tr>
				    
                    <tr onmouseover="this.bgColor='#F5F5F5';" onmouseout="this.bgColor='ffffff';" bgcolor="ffffff" id="selecttrstart">
                      <td class="left">排序</td>
                      <td><input type="text" name="orderid" id="orderid" value="<{$info['orderid']}>" class="skey" style="width:50px;" ></td>
                    </tr>
 

                    <input type="hidden" name="uid" id="uid" value="<{$info['id']}>" class="skey" style="width:150px;">
                   </tbody>
                </table>
              </div>
              <div class="blank20"></div>
               <input type="submit" value="确认提交" class="button">
            </form>
          </div>
        </div>
        <div class="blank20"></div>

      </div>
      <div class="clear"></div>
    </div>
</div>
 <!--newmain 结束-->
<script>
$('#submitImg').click(function(){
		ajaxFileUpload();
	});
	function ajaxFileUpload()
	{
		$("#loading")
		.ajaxStart(function(){
			$(this).show();
		})
		.ajaxComplete(function(){
			$(this).hide();
		});
  
		$.ajaxFileUpload
		(
			{
				url:'<{ofunc type=url link="/adminpage/news/module/noticeupload/datatype/json"}>',
				secureuri:false,
				fileElementId:'imgFile',
				dataType: 'json',
				data:{name:'logan', id:'id'},
				success: function (data, status)
				{
					if(typeof(data.error) != 'undefined')
					{
						if(data.error == false)
						{ 
						 
							$('#img').val(data.msg);
 	           $('#imgshow').attr('src',data.msg);
 	           $('#img').val(data.msg);
 	                $('#imgshow').show(); 
						}else
						{
							alert(data.msg);
						}
					}else{
					  alert(data);
					}
				},
				error: function (data, status, e)
				{
					alert(e);
				}
			}
		)
		
		return false;

	}
</script>
<{/block}>